
add_library(add  SHARED add.cpp)


set_target_properties(add PROPERTIES 

    COMPILE_OPTIONS "-g"
    COMPILE_OPTIONS "-O3"
    COMPILE_OPTIONS "-fPIC"
    # 类似于target_include_directories
    INCLUDE_DIRECTORIES "/public"
    INTERFACE_INCLUDE_DIRECTORIES "/interface"

    # 私有链接+接口路径 类似于target_link_directories  target_link_libraries
     LINK_DIRECTORIES "/public"
    INTERFACE_LINK_DIRECTORIES "/interface"
    LINK_LIBRARIES "curl"
    INTERFACE_LINK_LIBRARIES "jsoncpp"

    # 输出路径设置（相对与顶层cmakeLists.txt）
    RUNTIME_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/bin"
    ARCHIVE_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"
    LIBRARY_OUTPUT_DIRECTORY "${CMAKE_BINARY_DIR}/lib"

    # 设置参数
    BUILD_RPATH "${CMAKE_BINARY_DIR}/lib"#告诉编译器链接这个动态库的时候去这个路径搜索这个动态库
    INSTALL_RPATH "lib" #//usr/local/lib 没有/就是相对cmake_install_prefix
    OUTPUT_NAME "add"
    VERSION "1.2.3"
    SOVERSION "20"

)